limsControlmaterial.choosePage = {

    getGridParam: function () {
        var _this = this, columns = limsControlmaterial.getChooseListColumns();
        _this.param.single ? columns.unshift({
            radio: true
        }) : columns.unshift({
            checkbox: true
        });
        return {
            type: 'grid',
            id: 'lims-controlmaterial-choose-list-grid',
            url: limsControlmaterial.baseUrl + '/queries/choosable',
            requestData: {
                activeStatus_EQ: 'on',
                expirationDate_TG: Gikam.DateUtils.formatter(new Date(), 'yyyy-MM-dd hh:mm:ss')
            },
            columns: columns,
            toolbar: [{
                type: 'button',
                text: 'GIKAM.BUTTON.CONFIRM',
                icon: 'select',
                onClick: function () {
                    Gikam.getLastModal().close(Gikam.getComp('lims-controlmaterial-choose-list-grid').getSelections());
                }
            }],
            page: true
        }
    },

    create: function () {
        var _this = this;
        Gikam.create('layout', {
            id: 'lims-controlmaterial-choose-list-layout',
            renderTo: Gikam.getLastModal().window.$dom,
            center: {
                items: [this.getGridParam()]
            }
        });
    },

    init: function (param) {
        this.param = param;
        this.create();
    }
};
